package leetcode.code2201;

import leetcode.IDebug;

public class Solution implements IDebug {

	public int digArtifacts(int n, int[][] artifacts, int[][] dig) {
		int ans = 0;
		int[][] hash = new int[n][n];
		for (int i = 0; i < dig.length; i++) {
			int[] d = dig[i];
			hash[d[0]][d[1]] = 1;
		}
		for (int k = 0; k < artifacts.length; k++) {
			int[] art = artifacts[k];
			int r1i = art[0], c1i = art[1], r2i = art[2], c2i = art[3];
			boolean ok = true;
			for (int i = r1i; i <= r2i; i++) {
				for (int j = c1i; j <= c2i; j++) {
					if (hash[i][j] == 0) {
						ok = false;
					}
				}
			}
			if (ok) {
				ans++;
			}
		}
		return ans;
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
